#include <iostream>
#include "parse_xml_v2.h"

void printCrossEffect(CrossEffectConfig* pConfig) {
    std::cout << "Delay:" << std::endl;
    std::cout << "  Enabled: " << (pConfig->delay.enabled ? "true" : "false") << std::endl;
    std::cout << "  Duration: " << pConfig->delay.duration << " ms" << std::endl;
    std::cout << "  Except Channels: ";
    for (int channel : pConfig->delay.exceptChannels) {
        std::cout << channel << " ";
    }
    std::cout << std::endl;

    std::cout << "Remixes:" << std::endl;
    for (const Remix& remix : pConfig->remixes) {
        std::cout << "  Remix:" << std::endl;
        std::cout << "    Sources:" << std::endl;
        for (const Channel& source : remix.sources) {
            std::cout << "      Channel: " << source.channel << ", Gain: " << source.gain << std::endl;
        }
        std::cout << "    Target:" << std::endl;
        std::cout << "      Channel: " << remix.target.channel << ", Gain: " << remix.target.gain << std::endl;
    }
}

int main() {
    const char* filename = "cross_effect.xml.prod.v2";
    CrossEffectConfig* pCrossEffectConfig = new CrossEffectConfig;
    if (parseXml(pCrossEffectConfig, filename)) {
        printCrossEffect(pCrossEffectConfig);
    }
    delete pCrossEffectConfig;
     std::cout << "Going to Quit App." << std::endl;
    return 0;
}


